﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Discussions.master" AutoEventWireup="false" CodeFile="ListDiscussions.aspx.vb" Inherits="ListDiscussions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<fieldset>
<legend><label for="Title">Discussion LiSTS</label></legend>
    <asp:GridView ID="DG" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="DSDiscussions">
        <Columns>
            <asp:BoundField DataField="Topic" HeaderText="Topic" 
                SortExpression="Topic" />
            <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
            <asp:BoundField DataField="SubmittedDate" HeaderText="SubmittedDate" 
                SortExpression="SubmittedDate" />
            <asp:BoundField DataField="Replies" HeaderText="Replies" 
                SortExpression="Replies" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="DiscussionDetails.aspx?id={0}" DataTextField="ID" 
                DataTextFormatString="Proceed" HeaderText="Enter Discussion" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="DSDiscussions" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        
        SelectCommand="SELECT * FROM [QDiscussionSummary]"></asp:SqlDataSource>
        </fieldset>
        <br />
        <fieldset>
        <legend>Most Viewed Discussions</legend>
            <asp:Chart ID="Chart1" runat="server" DataSourceID="PopularDiscussions">
                <Series>
                    <asp:Series Name="Series1" XValueMember="Topic" YValueMembers="Popular">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                    </asp:ChartArea>
                </ChartAreas>
            </asp:Chart>
            <asp:SqlDataSource ID="PopularDiscussions" runat="server" 
                ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
                ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
                SelectCommand="SELECT * FROM [QPopDiscussion]"></asp:SqlDataSource>
        </fieldset>
</asp:Content>

